//
//  MK_LivingContent_Cell.m
//  miku直播
//
//  Created by 杨尚达 on 2017/7/26.
//  Copyright © 2017年 杨尚达. All rights reserved.
//

#import "MK_LivingContent_Cell.h"
#import "MK_LivingRoom_ImageView.h"

@interface MK_LivingContent_Cell ()

///标题
@property (weak, nonatomic) IBOutlet UILabel *titleLa;

///房间图片数组
@property (strong, nonatomic) IBOutletCollection(UIImageView) NSArray <MK_LivingRoom_ImageView*>*homeImageVArr;


@end
@implementation MK_LivingContent_Cell

- (void)awakeFromNib {
    [super awakeFromNib];
}

-(void)setModel:(MK_HotRoomModel *)model{
    
    _model = model;
    [_homeImageVArr enumerateObjectsUsingBlock:^(MK_LivingRoom_ImageView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        if (idx<model.rooms.count) {
            obj.hidden = NO;
            [obj sd_setImageWithURL:[NSURL URLWithString:model.rooms[idx].roomSrc] placeholderImage:[UIImage imageNamed:@"slide_default_image"]];
            [obj.nameButton setTitle:model.rooms[idx].nickname forState:UIControlStateNormal];
            [obj.numButton setTitle:[NSString stringWithFormat:@"%ld",model.rooms[idx].online] forState:UIControlStateNormal];
            obj.model = model.rooms[idx];
        }else{
            obj.hidden = YES;
        }
    }];
    
    _titleLa.text = model.tagName;
}

@end
